feat: add GradeEventContextEnricher pipeline step for grade analytics#2543
feat: add GradeEventContextEnricher pipeline step for grade analytics#2543pwnage101 wants to merge 2 commits into
Conversation
pwnage101
left a comment
There was a problem hiding this comment.
Aside from these changes, please also remember to bump the version of edx-enterprise.
Apologies if this wasn't clear, but these draft claude-generated PRs were meant to offer guidance and direction, not to be ready to go as-is.
ef579be to
a6e0632
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2543 +/- ##
=======================================
Coverage 86.04% 86.05%
=======================================
Files 250 251 +1
Lines 16707 16718 +11
Branches 1657 1658 +1
=======================================
+ Hits 14376 14387 +11
Misses 1997 1997
Partials 334 334
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a6e0632 to
de18e6a
Compare
de18e6a to
d0ab934
Compare
pwnage101
left a comment
There was a problem hiding this comment.
FYI, this PR and all future ones introducing a new filter will need to install the filter via enterprise/settings/common.py
7237868 to
8f926f3
Compare
8f926f3 to
ce68c0d
Compare
| "course_id": <unchanged>, | ||
| } | ||
| """ | ||
| uuids = EnterpriseCourseEnrollment.get_enterprise_uuids_with_user_and_course(user_id, course_id) |
There was a problem hiding this comment.
Please start this pipeline step with a log line to mirror all the other enterprise pipeline steps and improve stage/prod testing experience. Examples:
- https://github.com/openedx/edx-enterprise/blob/master/enterprise/filters/accounts.py#L54-L58
- https://github.com/openedx/edx-enterprise/blob/master/enterprise/filters/dashboard.py#L37-L42
Be sure to not log PII. In this case, probably just the user_id and course_id are sufficient (exclude the context to keep log size down).
Introduces enterprise/filters/grades.py with GradeEventContextEnricher, a PipelineStep for the org.openedx.learning.grade.context.requested.v1 filter that enriches grade analytics event context with the learner's enterprise UUID. Adds openedx-filters as a dependency and unit tests covering both enrichment and no-op branches.
ENT-11563
You can see it enriching the payload with the enterprise uuid correctly when fired directly

And in the COURSE_GRADE_PASSED_FIRST_TIME event sender also has the enterprise uuid information

Also tested with a user that doesn't have any enterprise associations, just prints enterprise uuid empty

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com
Blocked by:
Blocks: